package com.abe.jetpack.inject.viewmodel

import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import com.abe.jetpack.viewmodel.WanAndroidModel
import dagger.Binds
import dagger.Module
import dagger.multibindings.IntoMap

@Module
abstract class ViewModelModule {
    @Binds
    abstract fun bindViewModelFactory(factory: APPViewModelFactory): ViewModelProvider.Factory

    @Binds
    @IntoMap
    @ViewModelKey(WanAndroidModel::class)
    abstract fun bindWanAndroidViewModel(viewModel: WanAndroidModel): ViewModel
}